//
// Created by ZMX on 2017/10/23.
//

#include <stdexcept>
#include "Bitmap.h"
#include "main.h"

void Bitmap::Insert(std::pair<int, int> t) {
    if (t.first >= x && t.first <= x + w - 1 &&
        t.second >= y && t.second <= y + h - 1) {
        bm.insert(Node(t.first, t.second, 6));
    } else {
        throw runtime_error("invalid bitmap!");
    }
}

void Bitmap::PrintBitmap() {
    Print(bm, false);
}